package com.xuecheng.learning.convert;

import com.xuecheng.api.learning.model.dto.CourseRecordDTO;
import com.xuecheng.api.learning.model.vo.CourseRecordVo;
import com.xuecheng.learning.entity.CourseRecord;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Created on 2021/04/15/17:59 周四
 *
 * @author Lantin
 */
@Mapper
public interface CourseRecordConvert {

    CourseRecordConvert INSTANCE = Mappers.getMapper(CourseRecordConvert.class);


    @Mapping(source = "id", target = "courseRecordId")
    CourseRecordDTO courseRecordToDTO(CourseRecord courseRecord);

    @Mappings({
            @Mapping(source = "teachPlanId", target = "teachplanId"),
            @Mapping(source = "teachPlanName", target = "teachplanName")
    })
    CourseRecordDTO voToDTO(CourseRecordVo vo);

    List<CourseRecordDTO> courseRecordToDTOList(List<CourseRecord> list);
}
